import { Router } from 'express'
import { generateData1 } from '../utils/mockData.js'

const router = Router()

/**
 * @swagger
 * /user-info:
 *   get:
 *     tags:
 *       - 用户管理
 *     summary: '获取用户信息'
 *     description: '根据用户ID和名称获取用户详细信息'
 *     parameters:
 *       - in: query
 *         name: id
 *         schema:
 *           type: string
 *         description: '用户ID'
 *       - in: query
 *         name: name
 *         schema:
 *           type: string
 *         description: '用户名称'
 *         required: true
 *     responses:
 *       '200':
 *         description: '成功获取用户信息'
 *       '400':
 *         description: '参数错误，缺少必要参数'
 */
// 用户信息 /user-info:
router.get('/', (req, res) => {
    let {id, name} = req.query
    res.json(generateData1({id, name}))
})

export default router